package com.sso.common;

import java.util.UUID;

import com.tools.util.PropertiesUtils;


public class ConstantDate {

	/**
	 * UUID
	 * @return
	 */
	public static String getUUID() {
		String s = UUID.randomUUID().toString();
		// 去掉“-”符号
		return s.substring(0, 8) + s.substring(9, 13) + s.substring(14, 18)
				+ s.substring(19, 23) + s.substring(24);
	}
	/**
	 * 配置文件相当常量
	 * @author Admin
	 *
	 */
	public static class UctConfig{
		/**
		 * 登陆地址
		 */
		public static final String LOGIN_URL = PropertiesUtils.getValueByProperty("login_url", "/config/uct.properties");
		/**
		 * 退出地址
		 */
		public static final String LOGIN_OUT_URL =PropertiesUtils.getValueByProperty("login_out_url", "/config/uct.properties");
		/**
		 * 没有权限地址
		 */
		public static final String UNAUTHORIZED_URL=PropertiesUtils.getValueByProperty("unauthorized_url", "/config/uct.properties");
	}

	/**
	 * 接口返回信息集合
	 */
	public static class InterfaceStatus{
		//系统级别
		public static final String SYS_ACCESS_ERROR="SYS1000";	//访问失败
		public static final String SYS_PARAM_ERROR="SYS1001";	//参数解析异常
		public static final String SYS_KEY_ERROR="SYS1003";		//密钥异常
		//用户级别
		public static final String RETURN_SUCCESS="1000";	//返回成功
		public static final String LOGIN_ERROR="1001";   //返回成功
		public static final String USERNAME_ERROR="1002";	//用户名错误
		public static final String PASSWORD_ERROR="1003";	//密码错误
	}

	/**
	 * 对称加密固定式密码
	 */
	public static class DESPassword{
		public static final String SSO_TOKEN=PropertiesUtils.getValueByProperty("ssoToKen","/desPassword.properties");
	}

	/**
	 * 菜单表状态值
	 * 
	 * @author Admin
	 * 
	 */
	public enum MenuStatus {
		NORMAL("1", "正常"), DISCARD("2", "停用");
		public String key, chinese;

		private MenuStatus(String key, String chinese) {
			this.key = key;
			this.chinese = chinese;
		}
	}

	/**
	 * 角色表状态 table sys_role
	 * 
	 * @author Admin
	 * 
	 */
	public enum RoleStatus {
		NORMAL("1", "正常"), DISCARD("2", "停用"), DEL("3", "删除");
		public String key, chinese;

		private RoleStatus(String key, String chinese) {
			this.key = key;
			this.chinese = chinese;
		}
	}

	/**
	 * 权限表状态 talbe sys_audit
	 * 
	 * @author Admin
	 * 
	 */
	public enum AuditStatus {
		NORMAL("1", "正常"), DISCARD("2", "停用"), DEL("3", "删除");
		public String key;
		public String chinese;

		private AuditStatus(String key, String chinese) {
			this.key = key;
			this.chinese = chinese;
		}
	}
}
